package org.oslims.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.google.gwt.i18n.client.DateTimeFormat;

@Entity
@DiscriminatorValue("DATE")
public class DateParameterResult extends ParameterResult {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2324596649113443344L;
	@Column(name = "DATE_RESULT")
	@Temporal(TemporalType.TIMESTAMP)
	private Date result;

	public Date getResult() {
		return result;
	}

	public void setResult(Date result) {
		this.result = result;
	}

	@Override
	public String toString() {
		if (result != null)
			return DateTimeFormat.getShortDateTimeFormat().format(result);
		return "";
	}

}
